<!DOCTYPE html>
<html>
<head>
    ${print "${include "} "layout/header.html" .}
</head>

${print "${include "} "layout/nav.html" .}
<div class="main-content" style="min-height: 490px;">
    <section class="section" id="rrapp" v-cloak>
        <div class="section-header">
            <h1>${.comments}</h1>
            <div class="section-header-button" v-show="showList">
                <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增${.comments}</a>
                <a class="btn btn-primary" @click="bulkdel"><i class="fa fa-trash-o"></i>批量删除</a>
            </div>
            <div class="section-header-breadcrumb">
                <div class="breadcrumb-item active"><a href="/">首页</a></div>
                <div class="breadcrumb-item"><a href="/${.pathName}">${.comments}</a></div>
                <div class="breadcrumb-item"><a href="/${.pathName}">列表</a></div>
            </div>
        </div>
        <div class="section-body">
            <div class="row">
                <div class="col-12">
                    <div>
                        <div v-show="showList">
                            <div class="card" id="page-card">
                                <div class="card-header">
                                    <h4>${.title}列表</h4>
                                    <div class="card-header-form" id="toolbar">
                                        <div class="input-group search">
                                            <input type="text" class="form-control search-input" placeholder="查询">
                                            <div class="input-group-btn">
                                                <button class="btn btn-primary" id="search-btn" name="search" ><i
                                                            class="fas fa-search"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="card-body p-0">
                                    <div class=" ">
                                        <div class="table table-striped">
                                            <table id="table"></table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div v-show="!showList" class="card">
                            <div class="card-header"><h4>{{title}}${.comments}</h4></div>
                                <div class="card-body">
                                    ${- range $index,$column := .columns}
                                    ${- if( ne $column.ColumnName $.pk.ColumnName)}
                                    <div class="form-group row mb-4">
                                        <div class="col-form-label text-md-right col-12 col-md-3 col-lg-3">
                                            ${$column.Comments}
                                        </div>
                                        <div class="col-sm-12 col-md-7">
                                            <input type="text" class="form-control"
                                                   v-model="${$.classname}.${$column.AttrName}"
                                                   placeholder="${$column.Comments}"/>
                                        </div>
                                    </div>
                                    ${- end}
                                    ${- end}
                                </div>
                                <div class="card-footer bg-whitesmoke text-md-center">

                                    <input type="button" class="btn btn-primary" id="btnSaveOrUpdate"
                                           data-loading-text="保存中..."
                                           @click="saveOrUpdate" value="确定"/>
                                    &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload"
                                                       value="返回"/>
                                </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
${print "${include "} "layout/footer.html" .}
<script src="/modules/${.pathName}.js?_${.nowTime}"></script>
</body>
</html>
